def move(n,a,b):
    print(f"第{n}从{a}到{b}")

def hanio(n,a,b,c):
    if n == 1:
        move(n,a,b)
    else:
        hanio(n-1,a,c,b)
        move(n,a,b)
        hanio(n-1,c,b,a)

if __name__ == '__main__':
    n = 3
    hanio(3,'A','B','C')